perm filename A26.TEX[106,RWF] blob sn#807737 filedate 1985-09-20 generic text, type C, neo UTF8
COMMENT āŠ—   VALID 00002 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	\magnification\magstephalf
C00005 ENDMK
CāŠ—;
\magnification\magstephalf
\input macro.tex
\def\today{\ifcase\month\or
  January\or February\or March\or April\or May\or June\or
  July\or August\or September\or October\or November\or December\fi
  \space\number\day, \number\year}
\baselineskip 14pt
\rm
\line{\sevenrm a26.tex[106,phy] \today\hfill}

\bigskip
\ctrline{{\bf Example (Array)} [Incomplete]}

\bigskip
In the state of Paranoia, car licenses are six digit decimal numbers.
Every week, computer files are prepared, one (called ABAND) containing
the license numbers of all cars found abandoned along the roads, the
other (called STOLEN) containing the numbers of all cars reported stolen.
We want to find and print all license numbers common to both files,
so that the cars can be restored to their owners.

The program will read in, and store in an array, one of the files.
It will then read each number from the other file, search for it in
the array, stopping the search and printing if it is found.

Since in Paranoia far more cars are stolen than are ever found, it is
best to keep the abandoned licenses in the array, to keep the size
of the computation low. We will (internally) call the files
ABANDONED and STOLEN. Both will end with a 7-digit sentinel:
$\hbox{SENT}=9999999$. The first phase reads ABANDONED into an
array~$A$.
$$\hbox{READ}($$

\bigskip
\parindent0pt
\copyright 1984 Robert W. Floyd

First draft September 10, 1984


\bye